<?php

use Illuminate\Routing\Router;

Route::group([
    'prefix' => 'admin/topic',
    'namespace' => 'Frieza\\Modules\\Topic\\Controllers',
    'middleware' => [
        'web',
        'admin'
    ],
], function (Router $router) {
    //话题相关
    $router->get('/index', 'TopicNewController@index');//话题列表
    $router->get('/index/channel_info', 'TopicController@channelInfo');//话题频道
    $router->post('/index/channel_info/save', 'TopicController@saveChannelInfo');//话题频道保存
    $router->get('/index/create', 'TopicController@edit');//添加话题页面
    $router->get('/index/{id}/edit', 'TopicController@edit');//修改话题页面
    $router->post('/index/save', 'TopicController@submitTopic');//添加话题页面
    $router->delete('/index/{id}', 'TopicController@del');//删除话题
    $router->get('/index/setdown/{id}', 'TopicController@setDown');//下架话题
    $router->get('/index/setnormal/{id}', 'TopicController@setNormal');//上架话题
    $router->get('/index/settop', 'TopicController@setTop');//置顶话题
    $router->get('/index/unsettop/{id}', 'TopicController@unSetTop');//取消置顶话题
    $router->get('/topanswerlist', 'TopicController@topAnswerList');//回答固定位置
    $router->post('/topanswer/save', 'TopicController@topAnswerSave');//回答固定位置保存
    //角标设置-wt
    $router->get('/{id}/iconchange', 'TopicController@iconChange');//角标设置页面（弹框）
    $router->post('/index/seticon', 'TopicController@setIcon');//角标设置
    $router->get('/index/closeview', 'TopicController@closeView');//自动关闭页面
    //tab相关
    $router->get('/topictab/{id}', 'TopicTabController@index');//tab列表
    $router->get('/topictab/list/{id}/{tab_id}', 'TopicTabController@tabAnswerList');//tab中回答列表
    $router->get('/topictab/{id}/create', 'TopicTabController@add');//添加tab页面
    $router->get('/topictab/{id}/{tab_id}/edit', 'TopicTabController@edit');//修改tab页面
    $router->post('/topictab/save', 'TopicTabController@editSubmit');//添加、修改tab提交
    $router->delete('/topictab/{topic_id}/{tab_id}', 'TopicTabController@del');//删除tab
    $router->post('/topictab/sort', 'TopicTabController@sort');//tab排序
    //banner相关
    $router->get('/topicbanner/{id}', 'TopicBannerController@index');//banner列表
    $router->get('/topicbanner/{id}/create', 'TopicBannerController@add');//添加banner页面
    $router->get('/topicbanner/{id}/{banner_id}/edit', 'TopicBannerController@edit');//修改banner页面
    $router->post('/topicbanner/save', 'TopicBannerController@editSubmit');//添加、修改banner提交
    $router->delete('/topicbanner/{topic_id}/{banner_id}', 'TopicBannerController@del');//删除banner
    // 话题置顶相关
    $router->get('{topId}/topTopic', 'TopTopicController@index'); // 置顶话题列表
    $router->get('{topId}/topTopic/create', 'TopTopicController@create'); // 创建置顶话题
    $router->get('{topId}/topTopic/{id}/edit', 'TopTopicController@create'); // 编辑置顶话题
    $router->post('{topId}/topTopic/save', 'TopTopicController@save'); // 修改置顶话题
    $router->delete('{topId}/topTopic/{id}', 'TopTopicController@delete'); // 删除置顶话题
    $router->get('/toplist', 'TopTopicController@topList');//全部话题置顶列表
    $router->post('/sort', 'TopTopicController@sortTop');//全部话题置顶排序

    // 话题奖品
    $router->get('/{topId}/topicPrize', 'TopicPrizeController@index'); // 话题奖品列表
    $router->get('/{topId}/topicPrize/create', 'TopicPrizeController@edit'); // 编辑奖品页面
    $router->get('/{topId}/topicPrize/{id}/edit', 'TopicPrizeController@edit'); // 编辑奖品页面
    $router->post('/{topId}/topicPrize/save', 'TopicPrizeController@save'); // 保存修改
    $router->delete('/{topId}/topicPrize/{id}', 'TopicPrizeController@delete'); // 删除奖品

    //话题榜单
    $router->get('hot/index', 'TopicHotController@index'); // 榜单列表
    $router->post('hot/sort', 'TopicHotController@sort'); // 排序
    $router->get('hot/index/create', 'TopicHotController@create'); // 创建以及修改展示
    $router->get('hot/edit/{id}', 'TopicHotController@create'); // 创建以及修改展示
    $router->post('hot/save', 'TopicHotController@save'); // 创建以及修改保存
    $router->get('hot/{rank_id}/info', 'RankTopicListController@info'); //榜单详情
    $router->put('hot/{rank_id}/info/{topic_id}', 'RankTopicListController@changehot'); //人工修改热度值

    //合并后的话题
    $router->get('new', 'TopicNewController@index');//话题列表
    $router->get('new/create', 'TopicNewController@edit');//添加话题页面
    $router->post('new/save', 'TopicNewController@submitTopic');//添加话题页面
    $router->get('new/{id}/edit', 'TopicNewController@edit');//编辑话题页面
    $router->get('new/getCategoryLabel', 'TopicNewController@getCategoryLabel')->name('getCategoryLabel');//根据一级品类获取二级品类
    $router->get('new/toplist', 'TopicNewController@topList');//全部话题置顶列表
    $router->get('topic/toplist/create', 'TopicTabController@add');//添加tab页面
    $router->delete('new/toplist/{id}', 'TopicNewController@deleteTop'); // 删除置顶话题
    $router->get('new/index/setdown/{id}', 'TopicNewController@setDown');//下架话题
    $router->get('new/index/setnormal/{id}', 'TopicNewController@setNormal');//上架话题
    //合并后的角标设置
    $router->get('new/{id}/iconchange', 'TopicNewController@iconChange');//角标设置页面（弹框）
    $router->post('new/index/seticon', 'TopicNewController@setIcon');//角标设置
    $router->get('new/index/closeview', 'TopicNewController@closeView');//自动关闭页面
    $router->post('new/sort', 'TopTopicController@sortTop');//全部话题置顶排序

    $router->get('communitylist', 'TopicNewController@communityList');//社区频道话题列表
    $router->get('recommendtopic/create', 'TopicNewController@recommendTopicCreate'); // 创建推荐话题
    $router->post('recommendtopic/save', 'TopicNewController@recommendTopicSave'); // 修改置顶话题
    $router->get('recommendtopic/{id}/edit', 'TopicNewController@recommendTopicCreate'); // 编辑推荐话题
    $router->delete('communitylist/{id}', 'TopicNewController@deleteRecommend'); // 删除置顶话题
    $router->post('communitylist/sort', 'TopicNewController@sortRecommend');//全部话题置顶排序

    $router->get('awardslist', 'TopicNewController@awardsList');//有奖tab话题列表
    $router->get('awardstopic/create', 'TopicNewController@awardsTopicCreate'); // 创建有奖话题
    $router->post('awardstopic/save', 'TopicNewController@awardsTopicSave'); // 修改有奖tab话题
    $router->get('awardstopic/{id}/edit', 'TopicNewController@awardsTopicCreate'); // 编辑有奖tab话题
    $router->delete('awardslist/{id}', 'TopicNewController@deleteAwards'); // 删除有奖tab话题
    $router->post('awardslist/sort', 'TopicNewController@sortAwards');//有奖tab话题排序

});